package file.Practice;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class While {
    public static void main(String[] args) throws IOException{
        Boolean flag = true;
        do {
            System.out.print("请输入文件名:");
            String next = new Scanner(System.in).next();
            File file = new File("./src//file//5//" + next+".txt");
            if (file.exists()){
                System.out.println("文件名已存在，请重写输入:");
            }else {
                file.createNewFile();
                flag=false;
            }
        } while (flag);
    }
}